module ActiveTest::Asserts
  module Authorisation
    
    # Asserts that after the execution of the given block, a 403 response is returned.
    def assert_requires_permission
      yield
      assert_response 403
    end
    
    # Asserts that after the execution of the given block, a 403 response is not returned.
    def assert_accepts_permission
      yield
      assert @response.response_code != 403
    end

  end
end